<?php
/*
 * @Description  : 配置验证器
 * @Author       : 
 * @Date         : 2020-05-06
 * @LastEditTime : 2020-12-25
 */

namespace app\store\validate;

use think\Validate;

class SystemConfig extends Validate
{
    // 验证规则
    protected $rule = [
        'key'  => ['require', 'array'],
        'data' => ['require', 'array'],
    ];

    // 错误信息
    protected $message = [
        'key.require'  => '缺少参数：key',
        'key.array'    => '参数key类型不正确',
        'data.require' => '缺少参数：data',
        'data.array'   => '参数data类型不正确'
    ];

    // 验证场景
    protected $scene = [
        'get'      => ['key'],
        'batchSet' => ['data'],
    ];
}
